package factory;

import Dao.UserDao;
import Dao.UserDaoImpl;
import org.springframework.beans.factory.FactoryBean;


public class UserDaoFactoryBean implements FactoryBean<UserDao> {
//代替原始实例工厂中创建对象的方法
    @Override
    public UserDao getObject() throws Exception {
        return new UserDaoImpl();
    }

//类型是什么
    @Override
    public Class<?> getObjectType() {
        return UserDao.class;
    }
//是否是单例(true是 false不是)
    @Override
    public boolean isSingleton() {
        return true;
    }
}
